<template>
  <div>
    <Typenav></Typenav>
    <Listcontainer></Listcontainer>
    <TodayRecommend></TodayRecommend>
    <rank></rank>
    <like></like>
    <Floor v-for="(floor, index) in floorsList" :key="index" :list="floor"></Floor>
    <Brand></Brand>
  </div>
</template>

<script>
import Listcontainer from "@/pages/Home/Listcontainer.vue";
import TodayRecommend from "@/pages/Home/TodayRecommend.vue"
import Rank from "@/pages/Home/Rank.vue"
import Like from "@/pages/Home/Like.vue"
import Floor from "@/pages/Home/Floor.vue"
import Brand from "@/pages/Home/Brand.vue"
import { mapState } from 'vuex'
export default {
  name: "Home",
  components: { Listcontainer, TodayRecommend, Rank, Like, Floor, Brand },
  //在home组件中发，然后把数据传递给子组件
  mounted() {
    this.$store.dispatch("getFloorList")
    console.log(this.$store);
  },
  computed: {
    ...mapState({
      floorsList: state => state.home.floorsList,
      userInfo:state=>state.login.userInfo
    }),
  },
};
</script>

<style>
</style>